<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>2-单个事件</title>
		<!-- 导入Jquery库 -->
		<script type="text/javascript" src="js/jquery2.1.4.min.js"></script>
		<style type="text/css">
			.box{
				width:100px;
				height:100px;
				background:#000;
			}
			.cur{
				background:red;
			}
			.del{
				background:orange;
			}
		</style>
	</head>
	<body>
		<div class="box"></div>
		<script type="text/javascript">
			$(function(){
				//一个jquery元素对象绑定多个单一事件
				$('div').click(function(){
					console.log(1111);
					//removeClass()不传任何删除所有class
					$(this).addClass('cur').removeClass();
				});
				
				$('div').mouseover(function(){
					$(this).addClass('del');
				});
			});
		</script>
	</body>
</html>
